package c.j.a.c.g$g;

import c.j.a.b.a.c.a;
import c.j.a.c.o.b.b;
import com.huawei.agconnect.exception.AGCServerException;
import org.json.JSONException;
import org.json.JSONObject;

/* compiled from: PackageManagerChecker */
public class f {
    public static volatile f a;

    public void a(int i, int i2, a aVar) {
        if (aVar != null) {
            c.j.a.d.b.l.a d = c.j.a.d.b.l.a.d(aVar.q);
            if (d.b("report_api_hijack", 0) != 0) {
                int i3 = i2 - i;
                if (i > 0 && i3 > d.b("check_api_hijack_version_code_diff", AGCServerException.UNKNOW_EXCEPTION)) {
                    JSONObject jSONObject = new JSONObject();
                    try {
                        jSONObject.put("version_code_diff", i3);
                        jSONObject.put("installed_version_code", i2);
                        jSONObject.put("hijack_type", 1);
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                    b.a.n("api_hijack", jSONObject, aVar);
                }
            }
        }
    }
}
